aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/article/[slug].tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-09-29 11:47:06 +0200
committerArmand Philippot <git@armandphilippot.com>2023-10-24 12:25:00 +0200
commit81b1e0e05919eb368a66aef47adcf7738af76f29 (patch)
tree758577d3f58d7025f84bca5bac9bc0da8432deb7 /src/pages/article/[slug].tsx
parent3272ac336da52364ace5ed76d8f609d4088ffc06 (diff)
refactor(components): rewrite Spinner component
* Message should be set as children * Default message is no longer available (depending on use case, the consumer might prefer aria-label instead) * It is now possible to define the message position
Diffstat (limited to 'src/pages/article/[slug].tsx')
-rw-r--r--src/pages/article/[slug].tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx
index 3e4c38f..523e21d 100644
--- a/src/pages/article/[slug].tsx
+++ b/src/pages/article/[slug].tsx
@@ -71,8 +71,13 @@ const ArticlePage: NextPageWithLayout<ArticlePageProps> = ({
const { website } = useSettings();
const prismPlugins: OptionalPrismPlugin[] = ['command-line', 'line-numbers'];
const { attributes, className } = usePrism({ plugins: prismPlugins });
+ const loadingArticle = intl.formatMessage({
+ defaultMessage: 'Loading the requested article...',
+ description: 'ArticlePage: loading article message',
+ id: '4iYISO',
+ });
- if (isFallback || !article) return <Spinner />;
+ if (isFallback || !article) return <Spinner>{loadingArticle}</Spinner>;
const { content, id, intro, meta, title } = article;
const { author, commentsCount, cover, dates, seo, thematics, topics } = meta;